Eclipse JDT
Pre-release 3.0

org.eclipse.jdt.launching
Class VMRunnerConfiguration

java.lang.Object
  extended byorg.eclipse.jdt.launching.VMRunnerConfiguration

public class VMRunnerConfiguration
extends Object

Holder for various arguments passed to a VM runner. Mandatory parameters are passed in the constructor; optional arguments, via setters.

Clients may instantiate this class; it is not intended to be subclassed.


Constructor Summary
VMRunnerConfiguration(String classToLaunch, String[] classPath)
          Creates a new configuration for launching a VM to run the given main class using the given class path.
 
Method Summary
 String[] getAppendBootClassPath()
          Return the classpath entries to append to the boot classpath, or null null if none
 String[] getBootClassPath()
          Returns the boot classpath.
 String[] getClassPath()
          Returns the classpath.
 String getClassToLaunch()
          Returns the name of the class to launch.
 String[] getEnvironment()
          Returns the environment for the Java program or null
 String[] getMainBootClassPath()
          Return the main part of the boot classpath - null represents the default boot classpath.
 String[] getPrependBootClassPath()
          Return the classpath entries to prepend to the boot classpath, or null if none.
 String[] getProgramArguments()
          Returns the arguments to the Java program.
 String[] getVMArguments()
          Returns the arguments to the VM itself.
 Map getVMSpecificAttributesMap()
          Returns the Map that contains String name/value pairs that represent VM-specific attributes.
 String getWorkingDirectory()
          Returns the working directory of a launched VM.
 void setAppendBootClassPath(String[] appendBootClassPath)
          Sets the classpath entries to append to the boot classpath - null or empty if none.
 void setBootClassPath(String[] bootClassPath)
          Sets the boot classpath.
 void setEnvironment(String[] environment)
          Sets the environment for the Java program.
 void setMainBootClassPath(String[] bootClassPath)
          Sets the main boot classpath entries.
 void setPrependBootClassPath(String[] prependBootClassPath)
          Sets the classpath entries to prepend to the boot classpath - null or empty if none.
 void setProgramArguments(String[] args)
          Sets the custom program arguments.
 void setVMArguments(String[] args)
          Sets the custom VM arguments.
 void setVMSpecificAttributesMap(Map map)
          Sets the Map that contains String name/value pairs that represent VM-specific attributes.
 void setWorkingDirectory(String path)
          Sets the working directory for a launched VM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VMRunnerConfiguration

public VMRunnerConfiguration(String classToLaunch,
                             String[] classPath)
Creates a new configuration for launching a VM to run the given main class using the given class path.

Parameters:
classToLaunch - The fully qualified name of the class to launch. May not be null.
classPath - The classpath. May not be null.
Method Detail

setVMSpecificAttributesMap

public void setVMSpecificAttributesMap(Map map)
Sets the Map that contains String name/value pairs that represent VM-specific attributes.

Parameters:
map - the Map of VM-specific attributes.
Since:
2.0

setVMArguments

public void setVMArguments(String[] args)
Sets the custom VM arguments. These arguments will be appended to the list of VM arguments that a VM runner uses when launching a VM. Typically, these VM arguments are set by the user. These arguments will not be interpreted by a VM runner, the client is responsible for passing arguments compatible with a particular VM runner.

Parameters:
args - the list of VM arguments

setProgramArguments

public void setProgramArguments(String[] args)
Sets the custom program arguments. These arguments will be appended to the list of program arguments that a VM runner uses when launching a VM (in general: none). Typically, these VM arguments are set by the user. These arguments will not be interpreted by a VM runner, the client is responsible for passing arguments compatible with a particular VM runner.

Parameters:
args - the list of arguments

setEnvironment

public void setEnvironment(String[] environment)
Sets the environment for the Java program. The Java VM will be launched in the given environment.

Parameters:
environment - the environment for the Java program specified as an array of strings, each element specifying an environment variable setting in the format name=value
Since:
3.0

setPrependBootClassPath

public void setPrependBootClassPath(String[] prependBootClassPath)
Sets the classpath entries to prepend to the boot classpath - null or empty if none.

Parameters:
prependBootClassPath - the classpath entries to prepend to the boot classpath - null or empty if none
Since:
3.0

setMainBootClassPath

public void setMainBootClassPath(String[] bootClassPath)
Sets the main boot classpath entries. A value of null indicates the default boot classpath should be used (i.e. not specified on the command line), and empty array indicates an empty boot classpath attribute.

Parameters:
bootClassPath - the main boot classpath entries, possibly null
Since:
3.0

setAppendBootClassPath

public void setAppendBootClassPath(String[] appendBootClassPath)
Sets the classpath entries to append to the boot classpath - null or empty if none.

Parameters:
appendBootClassPath - the entries to append to the boot classpath - null or empty indicates none.
Since:
3.0

setBootClassPath

public void setBootClassPath(String[] bootClassPath)
Sets the boot classpath. Note that the boot classpath will be passed to the VM "as is". This means it has to be complete. Interpretation of the boot class path is up to the VM runner this object is passed to.

In release 3.0, support has been added for appending and prepending the boot classpath. Generally an IVMRunner should use the prepend, main, and append boot classpaths provided. However, in the case that an IVMRunner does not support these options, a complete boothpath should also be specified.

Parameters:
bootClassPath - The boot classpath. An emptry array indicates an empty bootpath and null indicates a default bootpath.

getVMSpecificAttributesMap

public Map getVMSpecificAttributesMap()
Returns the Map that contains String name/value pairs that represent VM-specific attributes.

Returns:
The Map of VM-specific attributes or null.
Since:
2.0

getClassToLaunch

public String getClassToLaunch()
Returns the name of the class to launch.

Returns:
The fully qualified name of the class to launch. Will not be null.

getClassPath

public String[] getClassPath()
Returns the classpath.

Returns:
the classpath

getPrependBootClassPath

public String[] getPrependBootClassPath()
Return the classpath entries to prepend to the boot classpath, or null if none.

Returns:
the classpath entries to prepend to the boot classpath, or null if none
Since:
3.0

getMainBootClassPath

public String[] getMainBootClassPath()
Return the main part of the boot classpath - null represents the default boot classpath.

Returns:
the main part of the boot classpath
Since:
3.0

getAppendBootClassPath

public String[] getAppendBootClassPath()
Return the classpath entries to append to the boot classpath, or null null if none

Returns:
the classpath entries to append to the boot classpath, or null if none
Since:
3.0

getBootClassPath

public String[] getBootClassPath()
Returns the boot classpath. An empty array indicates an empty bootpath and null indicates a default bootpah.

In 3.0, support has been added for prepending and appending to the boot classpath. The methods #getPrependBootClassPath(), #getMainBootClassPath(), and #getAppendBootClassPath() should be used instead of this method if an IVMRunner supports the options, as they may return more accurate information. In the case that the other options are not specified, and a single boot classpath is provided, an IVMRunner should honor the boot classpath specified by this method.

Returns:
The boot classpath. An emptry array indicates an empty bootpath and null indicates a default bootpah.
See Also:
setBootClassPath(String[])

getVMArguments

public String[] getVMArguments()
Returns the arguments to the VM itself.

Returns:
The VM arguments. Default is an empty array. Will not be null.
See Also:
setVMArguments(String[])

getProgramArguments

public String[] getProgramArguments()
Returns the arguments to the Java program.

Returns:
The Java program arguments. Default is an empty array. Will not be null.
See Also:
setProgramArguments(String[])

getEnvironment

public String[] getEnvironment()
Returns the environment for the Java program or null

Returns:
The Java program environment. Default is null
Since:
3.0

setWorkingDirectory

public void setWorkingDirectory(String path)
Sets the working directory for a launched VM.

Parameters:
path - the absolute path to the working directory to be used by a launched VM, or null if the default working directory is to be inherited from the current process
Since:
2.0

getWorkingDirectory

public String getWorkingDirectory()
Returns the working directory of a launched VM.

Returns:
the absolute path to the working directory of a launched VM, or null if the working directory is inherited from the current process
Since:
2.0

Eclipse JDT
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.